<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Block</title>
</head>

<body>
<?php
include("../connection/connection.php");
include("reportFunctions.php");
$distId=$_REQUEST['distId'];
$sqlReport = "SELECT distinct `district_id`,`district_name`,`block_id`,`block_name` FROM `tbl_lookup_location` where `district_id` = ".$distId." group by `block_id`";
$queryReport = mysql_query($sqlReport);

?>
<table border="0" width="800" cellspacing="0" cellpadding="0">
	<tr>
		<td bgcolor="#E9E9E9" height="26">
		<p align="center">
		<font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">
		Scheme wise status of Tubewell and Openwell</font></td>
	</tr>
	<tr>
		<td bgcolor="#E9E9E9" height="26">
		<p align="center">
		<font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">
		Table 16</font></td>
	</tr>
	<tr>
		<td bgcolor="#E9E9E9" height="56">
		<table border="1" width="800" cellspacing="0" cellpadding="0" height="49" bgcolor="#C5D8EB">
			<tr>
				
				
				<td width="74" rowspan="2" align="center">
				<font face="Verdana" style="font-size: 8.5pt"> 
				<b>Type of Source</b></font></td>
				<td width="61" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Type of Scheme</b></font></td>
				<td width="75" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Defunct (No.)</b></font></td>
				<td width="72" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Operational (No.)</b></font></td>
				<td width="69" rowspan="2" align="center">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Total (No.)</b></font></td>
				
			</tr>
			
		</table>
		</td>
	</tr>
	<tr>
		<td>
		<table border="1" width="800" cellspacing="0" cellpadding="0" height="202" bordercolor="#C5D8EB" style="border: 1px solid #BBD1E8" bgcolor="#F9F9F9">
			
			<tr>
				
				
				<td width='165' height="25" align='left'><font face="Verdana" style="font-size: 8.5pt">Open Well</font></td>
				<td width='135' align='left'><font face="Verdana" style="font-size: 8.5pt">Piped</font></td>
				<td width='171' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_piped_ow_def=getTubeOpenWellSource($distId,'Open-Well','Piped','defunct'); ?></font></td>
				<td width='162' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_ow_piped_op=getTubeOpenWellSource($distId,'Open-Well','Piped','operation'); ?></font></td>
				
				<td width='155' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getTubeOpenWellSource($distId,'Open-Well','Piped','defunct')+getTubeOpenWellSource($distId,'Open-Well','Piped','operation');?></font></td>
			</tr>
			
			<tr>
				
				
				<td width='165' align='center'>&nbsp;</td>
				<td width='135' align='left'><font face="Verdana" style="font-size: 8.5pt">P & T</font></td>
				<td width='171' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_ow_well_def=getTubeOpenWellSource($distId,'Open-Well','P&T','defunct')+getTubeOpenWellSource($distId,'Open-Well','TSS(P&T)','defunct'); ?></font></td>
				<td width='162' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_op_well_op=getTubeOpenWellSource($distId,'Open-Well','P&T','operation')+getTubeOpenWellSource($distId,'Open-Well','TSS(P&T)','operation'); ?></font></td>
				
				<td width='155' align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_ow_well_def+$tot_op_well_op; //getTubeOpenWellSource($distId,'Open-Well','P&T','defunct')+getTubeOpenWellSource($distId,'Open-Well','P&T','operation');?></font></td>
			</tr>
			<tr>
			  <td align='center'>&nbsp;</td>
			  <td align='left'><font face="Verdana" style="font-size: 8.5pt">Sanitary Diggs</font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_sd_ow=getTubeOpenWellSource($distId,'Open-Well','Sanitary Diggs','defunct'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_ow_sd_op=getTubeOpenWellSource($distId,'Open-Well','Sanitary Diggs','operation'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getTubeOpenWellSource($distId,'Open-Well','Sanitary Diggs','defunct')+getTubeOpenWellSource($distId,'Open-Well','Sanitary Diggs','operation');?></font></td>
		  </tr>
			
			<tr>
			  <td align='center'>&nbsp;</td>
			  <td align='left'><font face="Verdana" style="font-size: 8.5pt">Regional WSS</font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_wss_ow_def=getTubeOpenWellSource($distId,'Open-Well','RWSS','defunct'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_ow_wss_op=getTubeOpenWellSource($distId,'Open-Well','RWSS','operation'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getTubeOpenWellSource($distId,'Open-Well','RWSS','defunct')+getTubeOpenWellSource($distId,'Open-Well','RWSS','operation');?></font></td>
		  </tr>
			<tr bgcolor="#E9E9E9">
			  <td height="20" align='left' colspan="2" bgcolor=""><font face="Verdana" style="font-size: 8.5pt">Total</font></td>
			  
			  <td height="20" align='center' bgcolor=""><font face="Verdana" style="font-size: 8.5pt"><?php echo $grandtot1=$tot_piped_ow_def+$tot_ow_well_def+$tot_sd_ow+$tot_wss_ow_def; //getTubeOpenWellSource($distId,'Open-Well','Piped','defunct')+getTubeOpenWellSource($distId,'Open-Well','P&T','defunct')+getTubeOpenWellSource($distId,'Open-Well','WSS','defunct');?></font></td>
			  <td height="20" align='center' bgcolor=""><font face="Verdana" style="font-size: 8.5pt"><?php echo $grandtot2=$tot_ow_piped_op+$tot_op_well_op+$tot_ow_sd_op+$tot_ow_wss_op; //getTubeOpenWellSource($distId,'Open-Well','Piped','operation')+getTubeOpenWellSource($distId,'Open-Well','P&T','operation')+getTubeOpenWellSource($distId,'Open-Well','WSS','operation');?></font></td>
			  <td height="20" align='center' bgcolor=""><font face="Verdana" style="font-size: 8.5pt"><?php echo $grandtotal1=$grandtot1+$grandtot2; ?></font></td>
		  </tr>
			<tr>
			  <td height="25" align='left'><font face="Verdana" style="font-size: 8.5pt">Tube Well</font></td>
			  <td align='left'><font face="Verdana" style="font-size: 8.5pt">Piped</font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_piped_def=getTubeOpenWellSource($distId,'Tube-Well','Piped','defunct'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_piped_op=getTubeOpenWellSource($distId,'Tube-Well','Piped','operation'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getTubeOpenWellSource($distId,'Tube-Well','Piped','defunct')+getTubeOpenWellSource($distId,'Tube-Well','Piped','operation');?></font></td>
		  </tr>
			<tr>
			  <td align='center'>&nbsp;</td>
			  <td align='left'><font face="Verdana" style="font-size: 8.5pt">P & T</font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_pnt_def=getTubeOpenWellSource($distId,'Tube-Well','P&T','defunct')+getTubeOpenWellSource($distId,'Tube-Well','TSS(P&T)','defunct'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_pnt_op=getTubeOpenWellSource($distId,'Tube-Well','P&T','operation')+getTubeOpenWellSource($distId,'Tube-Well','TSS(P&T)','operation'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_pnt_def+$tot_tw_pnt_op; //getTubeOpenWellSource($distId,'Tube-Well','P&T','defunct')+getTubeOpenWellSource($distId,'Tube-Well','P&T','operation');?></font></td>
		  </tr>
		  <tr>
			  <td align='center'>&nbsp;</td>
			  <td align='left'><font face="Verdana" style="font-size: 8.5pt">Sanitary Diggs</font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_sd_tw=getTubeOpenWellSource($distId,'Tube-Well','Sanitary Diggs','defunct'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_sd_op=getTubeOpenWellSource($distId,'Tube-Well','Sanitary Diggs','operation'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getTubeOpenWellSource($distId,'Tube-Well','Sanitary Diggs','defunct')+getTubeOpenWellSource($distId,'Tube-Well','Sanitary Diggs','operation');?></font></td>
		  </tr>
			<tr>
			  <td align='center'>&nbsp;</td>
			  <td align='left'><font face="Verdana" style="font-size: 8.5pt">Regional WSS</font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_wss_def=getTubeOpenWellSource($distId,'Tube-Well','RWSS','defunct'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo $tot_tw_wss_op=getTubeOpenWellSource($distId,'Tube-Well','RWSS','operation'); ?></font></td>
			  <td align='center'><font face="Verdana" style="font-size: 8.5pt"><?php echo getTubeOpenWellSource($distId,'Tube-Well','RWSS','defunct')+getTubeOpenWellSource($distId,'Tube-Well','RWSS','operation');?></font></td>
		  </tr>
			<tr bgcolor="#E9E9E9">
			  <td align='left' colspan="2" bgcolor="" height="22"><font face="Verdana" style="font-size: 8.5pt"><b>Total</b></font></td>
			  
			  <td align='center' bgcolor="" height="22"><font face="Verdana" style="font-size: 8.5pt"><b><?php echo $grandtot3=$tot_tw_piped_def+$tot_tw_pnt_def+$tot_sd_tw+$tot_tw_wss_def; //getTubeOpenWellSource($distId,'Tube-Well','Piped','defunct')+getTubeOpenWellSource($distId,'Tube-Well','P&T','defunct')+getTubeOpenWellSource($distId,'Tube-Well','WSS','defunct');?></b></font></td>
			  <td align='center' bgcolor="" height="22"><font face="Verdana" style="font-size: 8.5pt"><b><?php echo $grandtot4=$tot_tw_piped_op+$tot_tw_pnt_op+$tot_tw_sd_op+$tot_tw_wss_op; //getTubeOpenWellSource($distId,'Tube-Well','Piped','operation')+getTubeOpenWellSource($distId,'Tube-Well','P&T','operation')+getTubeOpenWellSource($distId,'Tube-Well','WSS','operation');?></b></font></td>
			  <td align='center' bgcolor="" height="22"><font face="Verdana" style="font-size: 8.5pt"><b><?php echo $grandtotal2=$grandtot3+$grandtot4; ?></b></font></td>
		  </tr>
			<tr bgcolor="#E9E9E9">
			
				<td height="24" align='left' colspan="2" bgcolor=""><font face="Verdana" style="font-size: 8.5pt"><b>Grand Total</b></font></td>
				
				<td height="24" align='center' bgcolor=""><font face="Verdana" style="font-size: 8.5pt"><b><?php echo $grandtot1+$grandtot3;?></b></font></td>
				<td height="24" align='center' bgcolor=""><font face="Verdana" style="font-size: 8.5pt"><b><?php echo $grandtot2+$grandtot4;?></b></font></td>
				<td height="24" align='center' bgcolor=""><font face="Verdana" style="font-size: 8.5pt"><b><?php echo $grandtotal1+$grandtotal2;?></b></font></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>


</body>

</html>